package excel.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SpecialCharacterUtl {
    /**
     * 把特殊字符全替换成下划线
     *
     * @param character
     * @return
     */
    public static String getSpecialCharacter(String character) {
        String regEx = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~！@#￥%……&*（）——+|{}【】‘；：”“’。，、？]";
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(character);
        return m.replaceAll("_").trim();
    }
}
